3.52 \(\int \frac {(a+b x^2)^2 \sin (c+d x)}{x} \, dx\)

Optimal. Leaf size=111 \[ a^2 \sin (c) \text {Ci}(d x)+a^2 \cos (c) \text {Si}(d x)+\frac {2 a b \sin (c+d x)}{d^2}-\frac {2 a b x \cos (c+d x)}{d}-\frac {6 b^2 \sin (c+d x)}{d^4}+\frac {6 b^2 x \cos (c+d x)}{d^3}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}-\frac {b^2 x^3 \cos (c+d x)}{d} \]

[Out]

6*b^2*x*cos(d*x+c)/d^3-2*a*b*x*cos(d*x+c)/d-b^2*x^3*cos(d*x+c)/d+a^2*cos(c)*Si(d*x)+a^2*Ci(d*x)*sin(c)-6*b^2*s
in(d*x+c)/d^4+2*a*b*sin(d*x+c)/d^2+3*b^2*x^2*sin(d*x+c)/d^2

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3339, 3303, 3299, 3302, 3296, 2637} \[ a^2 \sin (c) \text {CosIntegral}(d x)+a^2 \cos (c) \text {Si}(d x)+\frac {2 a b \sin (c+d x)}{d^2}-\frac {2 a b x \cos (c+d x)}{d}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}-\frac {6 b^2 \sin (c+d x)}{d^4}+\frac {6 b^2 x \cos (c+d x)}{d^3}-\frac {b^2 x^3 \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x^2)^2*Sin[c + d*x])/x,x]

[Out]

(6*b^2*x*Cos[c + d*x])/d^3 - (2*a*b*x*Cos[c + d*x])/d - (b^2*x^3*Cos[c + d*x])/d + a^2*CosIntegral[d*x]*Sin[c]
 - (6*b^2*Sin[c + d*x])/d^4 + (2*a*b*Sin[c + d*x])/d^2 + (3*b^2*x^2*Sin[c + d*x])/d^2 + a^2*Cos[c]*SinIntegral
[d*x]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3339

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*Sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Int[ExpandIntegran
d[Sin[c + d*x], (e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx &=\int \left (\frac {a^2 \sin (c+d x)}{x}+2 a b x \sin (c+d x)+b^2 x^3 \sin (c+d x)\right ) \, dx\\ &=a^2 \int \frac {\sin (c+d x)}{x} \, dx+(2 a b) \int x \sin (c+d x) \, dx+b^2 \int x^3 \sin (c+d x) \, dx\\ &=-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+\frac {(2 a b) \int \cos (c+d x) \, dx}{d}+\frac {\left (3 b^2\right ) \int x^2 \cos (c+d x) \, dx}{d}+\left (a^2 \cos (c)\right ) \int \frac {\sin (d x)}{x} \, dx+\left (a^2 \sin (c)\right ) \int \frac {\cos (d x)}{x} \, dx\\ &=-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \text {Ci}(d x) \sin (c)+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x)-\frac {\left (6 b^2\right ) \int x \sin (c+d x) \, dx}{d^2}\\ &=\frac {6 b^2 x \cos (c+d x)}{d^3}-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \text {Ci}(d x) \sin (c)+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x)-\frac {\left (6 b^2\right ) \int \cos (c+d x) \, dx}{d^3}\\ &=\frac {6 b^2 x \cos (c+d x)}{d^3}-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \text {Ci}(d x) \sin (c)-\frac {6 b^2 \sin (c+d x)}{d^4}+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.42, size = 82, normalized size = 0.74 \[ a^2 \sin (c) \text {Ci}(d x)+a^2 \cos (c) \text {Si}(d x)+\frac {b \left (2 a d^2+3 b \left (d^2 x^2-2\right )\right ) \sin (c+d x)}{d^4}-\frac {b x \left (2 a d^2+b \left (d^2 x^2-6\right )\right ) \cos (c+d x)}{d^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x^2)^2*Sin[c + d*x])/x,x]

[Out]

-((b*x*(2*a*d^2 + b*(-6 + d^2*x^2))*Cos[c + d*x])/d^3) + a^2*CosIntegral[d*x]*Sin[c] + (b*(2*a*d^2 + 3*b*(-2 +
 d^2*x^2))*Sin[c + d*x])/d^4 + a^2*Cos[c]*SinIntegral[d*x]

________________________________________________________________________________________

fricas [A]  time = 0.83, size = 114, normalized size = 1.03 \[ \frac {2 \, a^{2} d^{4} \cos \relax (c) \operatorname {Si}\left (d x\right ) - 2 \, {\left (b^{2} d^{3} x^{3} + 2 \, {\left (a b d^{3} - 3 \, b^{2} d\right )} x\right )} \cos \left (d x + c\right ) + 2 \, {\left (3 \, b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 6 \, b^{2}\right )} \sin \left (d x + c\right ) + {\left (a^{2} d^{4} \operatorname {Ci}\left (d x\right ) + a^{2} d^{4} \operatorname {Ci}\left (-d x\right )\right )} \sin \relax (c)}{2 \, d^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)^2*sin(d*x+c)/x,x, algorithm="fricas")

[Out]

1/2*(2*a^2*d^4*cos(c)*sin_integral(d*x) - 2*(b^2*d^3*x^3 + 2*(a*b*d^3 - 3*b^2*d)*x)*cos(d*x + c) + 2*(3*b^2*d^
2*x^2 + 2*a*b*d^2 - 6*b^2)*sin(d*x + c) + (a^2*d^4*cos_integral(d*x) + a^2*d^4*cos_integral(-d*x))*sin(c))/d^4

________________________________________________________________________________________

giac [C]  time = 1.03, size = 725, normalized size = 6.53 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)^2*sin(d*x+c)/x,x, algorithm="giac")

[Out]

1/2*(2*b^2*d^3*x^3*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c)^2 - a^2*d^4*imag_part(cos_integral(d*x))*tan(1/2*d*x + 1/
2*c)^2*tan(1/2*c)^2 + a^2*d^4*imag_part(cos_integral(-d*x))*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c)^2 - 2*a^2*d^4*si
n_integral(d*x)*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c)^2 + 2*b^2*d^3*x^3*tan(1/2*d*x + 1/2*c)^2 + 2*a^2*d^4*real_pa
rt(cos_integral(d*x))*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c) + 2*a^2*d^4*real_part(cos_integral(-d*x))*tan(1/2*d*x
+ 1/2*c)^2*tan(1/2*c) - 2*b^2*d^3*x^3*tan(1/2*c)^2 + 4*a*b*d^3*x*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c)^2 + a^2*d^4
*imag_part(cos_integral(d*x))*tan(1/2*d*x + 1/2*c)^2 - a^2*d^4*imag_part(cos_integral(-d*x))*tan(1/2*d*x + 1/2
*c)^2 + 2*a^2*d^4*sin_integral(d*x)*tan(1/2*d*x + 1/2*c)^2 - a^2*d^4*imag_part(cos_integral(d*x))*tan(1/2*c)^2
 + a^2*d^4*imag_part(cos_integral(-d*x))*tan(1/2*c)^2 - 2*a^2*d^4*sin_integral(d*x)*tan(1/2*c)^2 + 12*b^2*d^2*
x^2*tan(1/2*d*x + 1/2*c)*tan(1/2*c)^2 - 2*b^2*d^3*x^3 + 4*a*b*d^3*x*tan(1/2*d*x + 1/2*c)^2 + 2*a^2*d^4*real_pa
rt(cos_integral(d*x))*tan(1/2*c) + 2*a^2*d^4*real_part(cos_integral(-d*x))*tan(1/2*c) - 4*a*b*d^3*x*tan(1/2*c)
^2 - 12*b^2*d*x*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c)^2 + a^2*d^4*imag_part(cos_integral(d*x)) - a^2*d^4*imag_part
(cos_integral(-d*x)) + 2*a^2*d^4*sin_integral(d*x) + 12*b^2*d^2*x^2*tan(1/2*d*x + 1/2*c) + 8*a*b*d^2*tan(1/2*d
*x + 1/2*c)*tan(1/2*c)^2 - 4*a*b*d^3*x - 12*b^2*d*x*tan(1/2*d*x + 1/2*c)^2 + 12*b^2*d*x*tan(1/2*c)^2 + 8*a*b*d
^2*tan(1/2*d*x + 1/2*c) - 24*b^2*tan(1/2*d*x + 1/2*c)*tan(1/2*c)^2 + 12*b^2*d*x - 24*b^2*tan(1/2*d*x + 1/2*c))
/(d^4*tan(1/2*d*x + 1/2*c)^2*tan(1/2*c)^2 + d^4*tan(1/2*d*x + 1/2*c)^2 + d^4*tan(1/2*c)^2 + d^4)

________________________________________________________________________________________

maple [B]  time = 0.03, size = 236, normalized size = 2.13 \[ \frac {\left (c^{3}+c^{2}+c +1\right ) b^{2} \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (c^{2}+c +1\right ) \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}+\frac {2 \left (1+c \right ) a b \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}+\frac {6 \left (1+c \right ) b^{2} c^{2} \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{4}}+\frac {4 c a b \cos \left (d x +c \right )}{d^{2}}+\frac {4 c^{3} b^{2} \cos \left (d x +c \right )}{d^{4}}+a^{2} \left (\Si \left (d x \right ) \cos \relax (c )+\Ci \left (d x \right ) \sin \relax (c )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)^2*sin(d*x+c)/x,x)

[Out]

(c^3+c^2+c+1)/d^4*b^2*(-(d*x+c)^3*cos(d*x+c)+3*(d*x+c)^2*sin(d*x+c)-6*sin(d*x+c)+6*(d*x+c)*cos(d*x+c))-4*b^2*c
*(c^2+c+1)/d^4*(-(d*x+c)^2*cos(d*x+c)+2*cos(d*x+c)+2*(d*x+c)*sin(d*x+c))+2*(1+c)/d^2*a*b*(sin(d*x+c)-(d*x+c)*c
os(d*x+c))+6*(1+c)/d^4*b^2*c^2*(sin(d*x+c)-(d*x+c)*cos(d*x+c))+4*c/d^2*a*b*cos(d*x+c)+4*c^3/d^4*b^2*cos(d*x+c)
+a^2*(Si(d*x)*cos(c)+Ci(d*x)*sin(c))

________________________________________________________________________________________

maxima [C]  time = 2.09, size = 116, normalized size = 1.05 \[ \frac {{\left (a^{2} {\left (-i \, {\rm Ei}\left (i \, d x\right ) + i \, {\rm Ei}\left (-i \, d x\right )\right )} \cos \relax (c) + a^{2} {\left ({\rm Ei}\left (i \, d x\right ) + {\rm Ei}\left (-i \, d x\right )\right )} \sin \relax (c)\right )} d^{4} - 2 \, {\left (b^{2} d^{3} x^{3} + 2 \, {\left (a b d^{3} - 3 \, b^{2} d\right )} x\right )} \cos \left (d x + c\right ) + 2 \, {\left (3 \, b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 6 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)^2*sin(d*x+c)/x,x, algorithm="maxima")

[Out]

1/2*((a^2*(-I*Ei(I*d*x) + I*Ei(-I*d*x))*cos(c) + a^2*(Ei(I*d*x) + Ei(-I*d*x))*sin(c))*d^4 - 2*(b^2*d^3*x^3 + 2
*(a*b*d^3 - 3*b^2*d)*x)*cos(d*x + c) + 2*(3*b^2*d^2*x^2 + 2*a*b*d^2 - 6*b^2)*sin(d*x + c))/d^4

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {\sin \left (c+d\,x\right )\,{\left (b\,x^2+a\right )}^2}{x} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((sin(c + d*x)*(a + b*x^2)^2)/x,x)

[Out]

int((sin(c + d*x)*(a + b*x^2)^2)/x, x)

________________________________________________________________________________________

sympy [A]  time = 6.92, size = 160, normalized size = 1.44 \[ a^{2} \sin {\relax (c )} \operatorname {Ci}{\left (d x \right )} + a^{2} \cos {\relax (c )} \operatorname {Si}{\left (d x \right )} + 2 a b x \left (\begin {cases} - \cos {\relax (c )} & \text {for}\: d = 0 \\- \frac {\cos {\left (c + d x \right )}}{d} & \text {otherwise} \end {cases}\right ) - 2 a b \left (\begin {cases} - x \cos {\relax (c )} & \text {for}\: d = 0 \\- \frac {\begin {cases} \frac {\sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \cos {\relax (c )} & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right ) + b^{2} x^{3} \left (\begin {cases} - \cos {\relax (c )} & \text {for}\: d = 0 \\- \frac {\cos {\left (c + d x \right )}}{d} & \text {otherwise} \end {cases}\right ) - 3 b^{2} \left (\begin {cases} - \frac {x^{3} \cos {\relax (c )}}{3} & \text {for}\: d = 0 \\- \frac {\begin {cases} \frac {x^{2} \sin {\left (c + d x \right )}}{d} + \frac {2 x \cos {\left (c + d x \right )}}{d^{2}} - \frac {2 \sin {\left (c + d x \right )}}{d^{3}} & \text {for}\: d \neq 0 \\\frac {x^{3} \cos {\relax (c )}}{3} & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)**2*sin(d*x+c)/x,x)

[Out]

a**2*sin(c)*Ci(d*x) + a**2*cos(c)*Si(d*x) + 2*a*b*x*Piecewise((-cos(c), Eq(d, 0)), (-cos(c + d*x)/d, True)) -
2*a*b*Piecewise((-x*cos(c), Eq(d, 0)), (-Piecewise((sin(c + d*x)/d, Ne(d, 0)), (x*cos(c), True))/d, True)) + b
**2*x**3*Piecewise((-cos(c), Eq(d, 0)), (-cos(c + d*x)/d, True)) - 3*b**2*Piecewise((-x**3*cos(c)/3, Eq(d, 0))
, (-Piecewise((x**2*sin(c + d*x)/d + 2*x*cos(c + d*x)/d**2 - 2*sin(c + d*x)/d**3, Ne(d, 0)), (x**3*cos(c)/3, T
rue))/d, True))

________________________________________________________________________________________